import React from 'react';
import './index.less';
import render from 'src/hrpub/common/frame/render';
import {connect} from 'src/hrpub/common/store';
import {COMMON} from "../../../../unit/util";
import Act from "./actions"
import DetailHeader from "../Header"
import DetailTable from "../Table";
import DetailCommonAction from "../../actions/detailCommon";

const initData = {
    org: "", //组织
    psncl: "" //人员类别
}
const DetailWarper = render({
    actions: {
        thisAct: DetailCommonAction,
        cardAct: Act,
    },
    state: {
        searchVal: null,  // <string> 搜索所属组织/人员类别
        showAdv: false,  //高级按钮
        pageInfo: COMMON.pageInfo,  //分页
        advObj: {...initData},
        initData
    }
})(({props, action, state}) => {
    const {staffCom} = props;
    return (
        <div className={`${staffCom.page}-detail`}>
            <DetailHeader
                {...props}
                pageParam={{titel: COMMON.pageTotal, index: 0}}
                searchVal={state.searchVal}
                searchValChange={action.thisAct.searchValChange}
                searchClick={action.thisAct.search}
                updateState={action.thisAct.updateState}
                clickExport={action.thisAct.clickExport}
            />

            <DetailTable
                {...props}
                pageInfo={state.pageInfo}
                updateState={action.thisAct.updateState}
                search={action.thisAct.search}
            />
        </div>
    );

});

export default DetailWarper;